package com.hns.phone.energy.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hns.can.common.constants.GlobalConst;
import com.hns.can.common.formula.FillCodeDscValue;
import com.hns.can.common.formula.FillParamsVo;
import com.hns.frame.mybatis.Pagination;
import com.hns.frame.service.CommonService;
import com.hns.phone.energy.vo.DriverEnergyRankVo;
import com.hns.phone.energy.vo.NewEnergy;
import com.hns.tool.pub.PubUtil;

@Service
public class PhoneDriverEnergyService extends CommonService {

	@Autowired
    private FillCodeDscValue codeDscValue;
	
//	/**
//	 * 驾驶员能耗排名
//	 * @param vo
//	 * @return
//	 * @throws Exception
//	 * @author:zhangyu
//	 * @email:zhangyu2222z@sina.cn
//	 */
//	public Pagination getDriverEnergyRanking(NewEnergy vo) throws Exception {
//		Pagination page = this.myBatisPage("phoneDriverEnergy.getDriverEnergyRankingCount", 
//				"phoneDriverEnergy.getDriverEnergyRanking", vo, DriverEnergyRankVo.class);
//		List<Object> list = page.getData();
//		Map<String,String> map = new HashMap<String,String>();
//        map.put("lineName", GlobalConst.DEFAULT_CACHE_VALUE);
//        FillParamsVo fileVo1 = new FillParamsVo("lineId", map);
//        //转化生成车牌号、车辆类别、车辆、燃料类型
//        map= new HashMap<String,String>();
//        map.put("licPltNo",  GlobalConst.DEFAULT_CACHE_VALUE);
//        FillParamsVo fileVo3 = new FillParamsVo("carId", map);
//        //转化生成驾驶员名称
//        map = new HashMap<String,String>();
//        map.put("drvName",  GlobalConst.DEFAULT_CACHE_VALUE);
//        FillParamsVo fileVo4 = new FillParamsVo("drvId", map);
//        codeDscValue.fillInfoValue(list,new String[] {GlobalConst.CACHE_KEY_BASE_LINE_INFO, 
//            GlobalConst.CACHE_KEY_BASE_DRV_INFO, GlobalConst.CACHE_KEY_BASE_CAR_INFO}, fileVo1,  fileVo3, fileVo4);
//		page.setData(list);
//		return page;
//	}

	/**
	 * 驾驶员能耗排名（前五）
	 * @param vo
	 * @return
	 * @throws Exception
	 * @author:zhangyu
	 * @email:zhangyu2222z@sina.cn
	 */
	public List<DriverEnergyRankVo> getDriverEnergyRankingForFive(NewEnergy vo) {
		List<DriverEnergyRankVo> list = PubUtil.convertListMapToObject(this.sqlMapDao.selectList("phoneDriverEnergy.getDriverEnergyRankingForFive", vo), DriverEnergyRankVo.class);
		return list;
	}

}
